package com.ruanyun.modular.ry.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruanyun.base.pojo.node.ZTreeNode;
import com.ruanyun.modular.ry.entity.TDict;
import com.ruanyun.modular.ry.model.params.TDictParam;
import com.ruanyun.modular.ry.model.result.TDictResult;
import com.ruanyun.modular.ry.vo.req.TDictReqVo;
import com.ruanyun.modular.ry.vo.resp.TDictRespVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据字典表 Mapper 接口
 * </p>
 *
 * @author 刘耀
 * @since 2020-12-15
 */
@Repository
public interface TDictMapper extends BaseMapper<TDict> {

    /**
     * 获取列表
     *
     * @author 刘耀
     * @Date 2020-12-15
     */
    List<TDictResult> customList(@Param("paramCondition") TDictParam paramCondition);

    /**
     * 获取map列表
     *
     * @author 刘耀
     * @Date 2020-12-15
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TDictParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author 刘耀
     * @Date 2020-12-15
     */
    Page<TDictResult> customPageList(@Param("page") Page page, @Param("paramCondition") TDictParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author 刘耀
     * @Date 2020-12-15
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TDictParam paramCondition);

    /**
     * 左侧树
     *
     * @return
     */
    List<ZTreeNode> tree();

    /**
     * 分页
     *
     * @param page
     * @param tDictReqVo
     * @return
     */
    IPage<TDictRespVo> findPage(@Param("page") Page page, @Param("paramCondition") TDictReqVo tDictReqVo);


    //获取污染物种类
     @Select("SELECT name,dict_id as dictId  FROM sys_dict WHERE dict_type_id = 1386236388285845505")
    List<TDictRespVo> getPollutantsTypeList();
}
